package com.oauth.global.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DecoratedStackPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.oauth.components.client.ui.CommonResources;

public class WidgetMenu extends Composite {

	private static WidgetMenuUiBinder uiBinder = GWT.create(WidgetMenuUiBinder.class);

	interface WidgetMenuUiBinder extends UiBinder<Widget, WidgetMenu> {
	}

	@UiField
	DecoratedStackPanel stackPanel;

	@UiField
	VerticalPanel vPanel;

	public WidgetMenu() {
		initWidget(uiBinder.createAndBindUi(this));
		stackPanel.setStackText(0, "<div class=\"stackText\">My Widgets</div>", true);
		stackPanel.addStyleName(CommonResources.INSTANCE.css().stackText());
	}

	public void addMenu(WidgetMenuItem menuItem) {
		vPanel.add(menuItem);
	}

	public void addMenuSeparator() {
		vPanel.add(new HTML("<HR/>"));
	}
}
